//
//  SMBusinessRecordCell.m
//  lishiminOC
//
//  Created by p2p on 16/10/17.
//  Copyright © 2016年 p2p. All rights reserved.
//

#import "SMBusinessRecordCell.h"
#import "SMRecordView.h"

@interface SMBusinessRecordCell()
@property (nonatomic,strong)NSArray *dataArray;
@property (nonatomic,strong)SMRecordView *firstView;
@property (nonatomic,strong)SMRecordView *secondView;
@property (nonatomic,strong)SMRecordView *thirdView;
@end
@implementation SMBusinessRecordCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    
}

- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        //设置UI
        [self setupUI];
    }
    return self;
}

- (void)setupUI{
    CGFloat height = 45;
    for (int i =0 ;i <self.dataArray.count;i++) {
        SMRecordView *firstView = [[SMRecordView alloc]initWithFrame:CGRectMake(0, i*height, [UIScreen mainScreenWidth], height)];
        if (i == self.dataArray.count-1) {
            [firstView setUIDataWithDic:self.dataArray[i] andIntervalDisplay:YES];
        } else {
            [firstView setUIDataWithDic:self.dataArray[i] andIntervalDisplay:NO];
        }
        [self.contentView addSubview:firstView];
        
    }
}
- (void)layoutSubviews{
    
}

- (NSArray *)dataArray{
    if (_dataArray == nil) {
        _dataArray = @[
                       @{@"imageTitleString":@"buesnessList",@"titleName":@"交易记录",@"backImageString":@"arrow_gray"},
                       @{@"imageTitleString":@"purchaseList",@"titleName":@"申购记录",@"backImageString":@"arrow_gray"},
                       @{@"imageTitleString":@"enterAndOutList",@"titleName":@"出入金记录",@"backImageString":@"arrow_gray"}
                       ];
    }
    return _dataArray;
}
@end
